<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>标准规范</title>
    <script src="../../../js/header.js"></script>
</head>
<body>
<div id="pub" style="overflow: hidden;">
    <el-row type="flex" justify="center">
        <el-col :span="15">
            <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-top: 20px;margin-bottom: 20px;">
                <el-breadcrumb-item :to="{ path: '/' }"  @click.native="gobackmain()">首页</el-breadcrumb-item>
                <el-breadcrumb-item>标准规范</el-breadcrumb-item>
            </el-breadcrumb>
            <hr style="filter: alpha(opacity=100,finishopacity=0,style=3)" width="100%" color=#185392 SIZE=3>
            <!--展示列表-->
            <div style="overflow: hidden;width: 100%;">
                <ul v-for="item in tableData">
                    <li @click="view(item,$event)" style="margin-left: 5px;padding:20px 0px;font-size: 20px;">
                        <span style="width: 70%;margin-left:15px;float: left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">{{ item.title }}</span>
                        <span style="margin-right: 15px;float: right;">{{ item.releaseTime }}</span>
                    </li>
                </ul>
            </div>
            <div style="overflow: hidden;">
                <div class="pagination">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="[10]"
                            :page-size="pagesize"
                            background
                            layout="total, sizes,prev, pager, next"
                            :total="tableTotal"
                            prev-text="上一页"
                            next-text="下一页">
                    </el-pagination>
                </div>
            </div>
            <!--详情-->
            <el-dialog title="" :visible.sync="dialogView" center fullscreen>
                <gongshi-details :addform="addForm" :link="link"></gongshi-details>
            </el-dialog>
        </el-col>
    </el-row>
</div>
</body>
<script type="text/javascript">
    var vue = new Vue({
        el: '#pub',
        created: function () {
            var userInfo = JSON.parse(localStorage.getItem('userInfo'));
            this.name = userInfo.loginName;
        },
        data: function () {
            return {
                currentPage: 1,
                pagesize: 10,
                tableTotal:'',
                tableData: [],
                selectFormDisabled:false,
                selectForm: {
                    id:'',
                    title:'',
                    publicType:'1',
                },
                dialogView:false,
                uuid:'',
                from:'',
                link:'',//iframe链接
                addForm: {
                    id:'',
                    createUser:'',
                    createUserUnit:'',
                    createTime:'',
                    title:'',
                    publicityContent:'',
                    publicType:'',
                    from:''
                },
                addFormDisabled:false,
            }
        },
        mounted: function () {
            this.getData();
        },
        methods: {
            getData() {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;
                axios({
                    method: 'get',
                    url: '/dzjportal/promulgate/allList',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        publicType:this.selectForm.publicType,
                        isPublic:'0'
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = response.data.data.results;
                            this.tableTotal = response.data.data.total;// 数据长度
                            this.tableData = dataInformation;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            /* 列表页搜索 */
            searchForm(selectForm) {
                var pagesize = this.pagesize;
                var pageno = this.currentPage;

                axios({
                    method: 'get',
                    url:  '/dzjportal/promulgate/titleList',
                    params: {
                        pageSize: pagesize,
                        pageNo: pageno,
                        title: this.selectForm.title,
                        publicType:this.selectForm.publicType,
                        isPublic:'0'
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let dataInformation = response.data.data.results;
                            this.tableTotal = response.data.data.total;// 数据长度

                            this.tableData = dataInformation;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            /* 列表页重置 */
            resetForm(formName) {
                this.selectForm.title = '';
                this.getData();
            },
            //每页下拉显示数据
            handleSizeChange(size) {
                this.pagesize = size;
                this.getData();
            },
            //点击第几页
            handleCurrentChange(currentPage) {
                this.currentPage = currentPage;
                this.getData();
            },
            //查看
            view(row,e){
                this.dialogView=true;
                this.addFormDisabled=true;
                this.link = appBaseUrl + "/html/upload/annex.html?uuid="+row.id+"&flag=0&from="+row.from;
                axios({
                    method: 'get',
                    url: '/dzjportal/promulgate/selectOne',
                    params: {
                        id: row.id,
                        from:row.from
                    }
                })
                    .then(response => {
                        let data = response.data;
                        if (data.code == 200) {
                            let rowdata = response.data.data;
                            this.addForm = rowdata;
                        } else {
                            this.$message.error(data.msg);
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
            gobackmain(){
                parent.mainwork.backIndex();
            },

        },
    })
</script>
</html>
